
import { useSelector, useDispatch } from 'react-redux'

import { add,minus } from "./store/modules/count";
function Count() {


    const dispatch = useDispatch()

    const count = useSelector(state=>state.count.count)

    return <>
      <button onClick={()=>dispatch(add(1))}>+</button>
      <span>{count}</span>
      <button onClick={()=>dispatch(minus(1))}>-</button>
    </>
}

export default Count